package com.lmf.annotation.bean;

import org.springframework.beans.factory.annotation.Value;

public class Person_2 {

    /**
     * @Value():
     *      1.基本值
     *      2.写SqEL计算公式：#{}
     *      3.从属性文件中取值：${}
     */
    @Value("张三") //1.基本值
    private String name;
    @Value("#{20-2}") //2.写SqEL计算公式：#{}
    private Integer age;
    @Value("${person_2.work}")  //3.从属性文件中取值：${}
    private String work;

    public Person_2() {
    }

    public Person_2(String name, Integer age, String work) {
        this.name = name;
        this.age = age;
        this.work = work;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getWork() {
        return work;
    }

    public void setWork(String work) {
        this.work = work;
    }

    @Override
    public String toString() {
        return "Person_2{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", work='" + work + '\'' +
                '}';
    }
}
